<?php
class Dev_IndexController extends Veneer_Controller_Module
{
   	function init()
	{
		$this->_moduleName = 'dev';
		$this->_config_module;  // config object
		parent::init();

		if($this->_msite_config->main->mode != 'dev')
			print "here";
	}
	public function indexAction()
    {
		// list modules
    }
    public function createAction()
    {
		// create the ini file in moduledata/modulename.ini
    }
    public function createTableAction()
    {
		$table_name = $this->_veneer_parms['p1'];
		$this->view->title = "Create Script for " . $table_name;

        $stmt = $this->_dbAdapter->getConnection()->query('show create table ' . $table_name);
		$result = $stmt->fetch();
		$this->view->content = "<pre>" . $result['Create Table'] . "</pre>";
		$this->_helper->viewRenderer->renderScript('veneerShowContent.phtml');
    }
    public function tableListAction()
    {
		$this->view->title = "List of Tables";
//        $result = $this->_dbAdapter->getConnection()->query('SHOW TABLES');
        $result = $this->_dbAdapter->listTables();

        $this->view->objects = $result;
//		$this->_helper->viewRenderer->renderScript('veneerList.phtml');

    }
    public function new1Action()
    {
		$tableName=$this->_veneer_parms['p1'];
		$this->view->title = "List of Fields for $tableName";

        $result = $this->_dbAdapter->describeTable($tableName);
        $this->view->objects = $result;
		$this->_debug->print_r($result);

    }
    public function genShaAction()
    {
		if($this->getRequest()->isPost()) {
			$this->view->content = "<b>Hash value for:<br/>". $_POST['sha']
			. "<br/>is:<br/>" . sha1($_POST['sha']) ."<br/><br/>";
		}
    }
}

